<?php

class Admin_EstatisticasistemaController extends App_Controller_Action
{
    private $_table     = '';
    private $_pk        = '';
    private $_order_col = '';
    private $_order     = '';
    private $_sta_col   = '';
    private $obj        = '';
    private $form       = '';
    private $_file_col  = ''; 
    public  $dir        = 'public/upload//';
    
    
    public function init()
    {
        //if($this->getRequest()->getActionName() == 'edit') $this->form = new Admin_Form_();        
    }

    public function indexAction() {
        
        Zend_Loader::loadClass('tools','library');
        Zend_Loader::loadClass('datetools','library');
        Zend_Loader::loadClass('dominio','library');
        
        
        $query = ' SELECT SQL_CACHE count(*) as TOTAL'
                .' FROM ALUNO a '
                .' INNER JOIN MATRICULA m ON m.ALU_ID = a.ALU_ID AND MAT_STA = 1 '
                .' INNER JOIN CURSO ON CURSO.CUR_ID = m.CUR_ID AND CUR_STA = 1 AND CUR_ANO = "'.date('Y').'"'
                ;
        $result = $this->db->fetchRow($query);
        $this->view->matricula = $result;
        
        $query = 'SELECT count(*) as TOTAL FROM INFORMATION_SCHEMA.TABLES'
                .' WHERE TABLE_TYPE like "BASE TABLE"';
        $result = $this->db->fetchRow($query);
        $this->view->tabelas = $result;
    }  
    
}